package com.itheima.stock.mapper;

import com.itheima.stock.pojo.domain.SysUserDomain;
import com.itheima.stock.pojo.entity.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author 46035
 * @description 针对表【sys_user(用户表)】的数据库操作Mapper
 * @createDate 2022-09-19 15:48:56
 * @Entity com.itheima.stock.pojo.entity.SysUser
 */
public interface SysUserMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);

    /**
     * 根据用户名查询用户信息
     *
     * @param userName
     * @return
     */
    SysUser getUserByUserName(@Param("userName") String userName);

    /**
     * 多条件查询
     * @param username
     * @param nickName
     * @param startTime
     * @param endTime
     * @return
     */
    List<SysUserDomain> getUserInfosByMCondition(@Param("username") String username, @Param("nickName") String nickName, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    int addUser(@Param("user") SysUser user);

    int deleteUsersById(@Param("userIds") List<Long> userIds);
}
